package com.wishu.finance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.Data;

/**
 * 风控公寓授信主表
 *
 * @TableName t_fk_business_credit
 */
@TableName(value = "t_fk_business_credit")
@Data
public class TFkBusinessCredit implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 商户id
     */
    private Long businessId;

    /**
     * 商户注册日期
     */
    private Date registerDate;

    /**
     * 商户注册资本金
     */
    private BigDecimal registerCapital;

    /**
     * 授信状态，1：已授信、2：未授信
     */
    private Integer creditStaus;

    /**
     * 应花分期使用
     */
    private String appid;

    /**
     * 海链总授信额度
     */
    private BigDecimal hlTotalCreditline;

    /**
     * 海链已用授信额度
     */
    private BigDecimal hlUsedCreditline;

    /**
     * 海链月授信额度
     */
    private BigDecimal hlMonthlyTotalCreditline;

    /**
     * 海链月已用授信额度
     */
    private BigDecimal hlMonthlyUsedCreditline;

    /**
     * 预留字段1
     */
    private BigDecimal reserve1;

    /**
     * 预留字段2
     */
    private Integer reserve2;

    /**
     * 预留字段3
     */
    private String reserve3;

    /**
     * 预留字段4
     */
    private String reserve4;

    /**
     * 预留字段5
     */
    private String reserve5;

    /**
     * 删除标识   0：未删除、1：删除
     */
    private Integer delFlg;

    /**
     * 创建用户id
     */
    private Long createUserid;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新用户id
     */
    private Long updateUserid;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TFkBusinessCredit other = (TFkBusinessCredit) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getBusinessId() == null ? other.getBusinessId() == null : this.getBusinessId().equals(other.getBusinessId()))
                && (this.getRegisterDate() == null ? other.getRegisterDate() == null : this.getRegisterDate().equals(other.getRegisterDate()))
                && (this.getRegisterCapital() == null ? other.getRegisterCapital() == null : this.getRegisterCapital().equals(other.getRegisterCapital()))
                && (this.getCreditStaus() == null ? other.getCreditStaus() == null : this.getCreditStaus().equals(other.getCreditStaus()))
                && (this.getAppid() == null ? other.getAppid() == null : this.getAppid().equals(other.getAppid()))
                && (this.getHlTotalCreditline() == null ? other.getHlTotalCreditline() == null : this.getHlTotalCreditline().equals(other.getHlTotalCreditline()))
                && (this.getHlUsedCreditline() == null ? other.getHlUsedCreditline() == null : this.getHlUsedCreditline().equals(other.getHlUsedCreditline()))
                && (this.getHlMonthlyTotalCreditline() == null ? other.getHlMonthlyTotalCreditline() == null : this.getHlMonthlyTotalCreditline().equals(other.getHlMonthlyTotalCreditline()))
                && (this.getHlMonthlyUsedCreditline() == null ? other.getHlMonthlyUsedCreditline() == null : this.getHlMonthlyUsedCreditline().equals(other.getHlMonthlyUsedCreditline()))
                && (this.getReserve1() == null ? other.getReserve1() == null : this.getReserve1().equals(other.getReserve1()))
                && (this.getReserve2() == null ? other.getReserve2() == null : this.getReserve2().equals(other.getReserve2()))
                && (this.getReserve3() == null ? other.getReserve3() == null : this.getReserve3().equals(other.getReserve3()))
                && (this.getReserve4() == null ? other.getReserve4() == null : this.getReserve4().equals(other.getReserve4()))
                && (this.getReserve5() == null ? other.getReserve5() == null : this.getReserve5().equals(other.getReserve5()))
                && (this.getDelFlg() == null ? other.getDelFlg() == null : this.getDelFlg().equals(other.getDelFlg()))
                && (this.getCreateUserid() == null ? other.getCreateUserid() == null : this.getCreateUserid().equals(other.getCreateUserid()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateUserid() == null ? other.getUpdateUserid() == null : this.getUpdateUserid().equals(other.getUpdateUserid()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBusinessId() == null) ? 0 : getBusinessId().hashCode());
        result = prime * result + ((getRegisterDate() == null) ? 0 : getRegisterDate().hashCode());
        result = prime * result + ((getRegisterCapital() == null) ? 0 : getRegisterCapital().hashCode());
        result = prime * result + ((getCreditStaus() == null) ? 0 : getCreditStaus().hashCode());
        result = prime * result + ((getAppid() == null) ? 0 : getAppid().hashCode());
        result = prime * result + ((getHlTotalCreditline() == null) ? 0 : getHlTotalCreditline().hashCode());
        result = prime * result + ((getHlUsedCreditline() == null) ? 0 : getHlUsedCreditline().hashCode());
        result = prime * result + ((getHlMonthlyTotalCreditline() == null) ? 0 : getHlMonthlyTotalCreditline().hashCode());
        result = prime * result + ((getHlMonthlyUsedCreditline() == null) ? 0 : getHlMonthlyUsedCreditline().hashCode());
        result = prime * result + ((getReserve1() == null) ? 0 : getReserve1().hashCode());
        result = prime * result + ((getReserve2() == null) ? 0 : getReserve2().hashCode());
        result = prime * result + ((getReserve3() == null) ? 0 : getReserve3().hashCode());
        result = prime * result + ((getReserve4() == null) ? 0 : getReserve4().hashCode());
        result = prime * result + ((getReserve5() == null) ? 0 : getReserve5().hashCode());
        result = prime * result + ((getDelFlg() == null) ? 0 : getDelFlg().hashCode());
        result = prime * result + ((getCreateUserid() == null) ? 0 : getCreateUserid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUserid() == null) ? 0 : getUpdateUserid().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", businessId=").append(businessId);
        sb.append(", registerDate=").append(registerDate);
        sb.append(", registerCapital=").append(registerCapital);
        sb.append(", creditStaus=").append(creditStaus);
        sb.append(", appid=").append(appid);
        sb.append(", hlTotalCreditline=").append(hlTotalCreditline);
        sb.append(", hlUsedCreditline=").append(hlUsedCreditline);
        sb.append(", hlMonthlyTotalCreditline=").append(hlMonthlyTotalCreditline);
        sb.append(", hlMonthlyUsedCreditline=").append(hlMonthlyUsedCreditline);
        sb.append(", reserve1=").append(reserve1);
        sb.append(", reserve2=").append(reserve2);
        sb.append(", reserve3=").append(reserve3);
        sb.append(", reserve4=").append(reserve4);
        sb.append(", reserve5=").append(reserve5);
        sb.append(", delFlg=").append(delFlg);
        sb.append(", createUserid=").append(createUserid);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUserid=").append(updateUserid);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}